<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:th="https://www.thymeleaf.org"
	xmlns:sec="https://www.thymeleaf.org/thymeleaf-extras-springsecurity5">
<head>
<title>Spring Security OAuth 2.0 Sample</title>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport"
	content="width=device-width, initial-scale=1, shrink-to-fit=no">
<link rel="stylesheet" href="/webjars/bootstrap/css/bootstrap.css"
	th:href="@{/webjars/bootstrap/css/bootstrap.css}" />
</head>
<body>
	<div th:fragment="header">
		<nav class="navbar navbar-default">
			<div class="container">
				<div class="container-fluid">
					<div class="navbar-collapse collapse" id="navbar">
						<ul class="nav navbar-nav navbar-right">
							<li class="dropdown"><a id="user-menu" href="#"
								class="dropdown-toggle" data-toggle="dropdown" role="button"
								aria-haspopup="true" aria-expanded="false"> <span
									sec:authentication="name">User</span>
							</a>
								<ul class="dropdown-menu">
									<li><a id="sign-out"
										href="javascript:document.logoutForm.submit()">Sign Out</a></li>
								</ul>
								<form name="logoutForm" th:action="@{/logout}" method="post"
									th:hidden="true">
									<input hidden type="submit" value="Sign Out" />
								</form></li>
						</ul>
					</div>
				</div>
			</div>
		</nav>
	</div>
	<div class="container">
		<div class="panel panel-default">
			<div class="panel-heading">
				<h3 class="panel-title">
					Authorize the client with <span style="font-family: monospace">grant_type</span>:
				</h3>
			</div>
			<ul class="list-group">
				<li class="list-group-item"><a
					href="/oauthClient/oauth/authorize?grant_type=authorization_code"
					th:href="@{/oauth/authorize?grant_type=authorization_code}"><span
						style="font-size: medium">Authorization Code</span></a></li>
				<li class="list-group-item"><a
					href="/oauth/authorize?grant_type=client_credentials"
					th:href="@{/oauth/authorize?grant_type=client_credentials}"><span
						style="font-size: medium">Client Credentials</span></a></li>
				<li class="list-group-item">
					<div>
						<p style="font-size: medium">Resource Owner Password
							Credentials</p>
						<form th:action="@{/oauth/authorize}" method="post">
							<div class="form-row">
								<div class="form-group">
									<label for="username" style="font-size: small">Username</label>
									<input type="text" id="username" name="username"
										class="form-control input-sm"> <small
										class="form-text text-muted">user1 / password</small>
								</div>
							</div>
							<div class="form-row">
								<div class="form-group">
									<label for="password" style="font-size: small">Password</label>
									<input type="password" id="password" name="password"
										class="form-control input-sm">
								</div>
							</div>
							<input type="hidden" id="grant_type" name="grant_type"
								value="password">
							<button type="submit" class="btn btn-primary btn-sm">Authorize</button>
						</form>
					</div>
				</li>
			</ul>
			<div th:if="${messages}" class="panel-footer">
				<h4>Messages:</h4>
				<table class="table table-condensed">
					<tbody>
						<tr class="row" th:each="message : ${messages}">
							<td th:text="${message}">message</td>
						</tr>
					</tbody>
				</table>
			</div>
		</div>
	</div>
	<script src="/webjars/jquery/jquery.min.js"
		th:src="@{/webjars/jquery/jquery.min.js}"></script>
	<script src="/webjars/bootstrap/js/bootstrap.min.js"
		th:src="@{/webjars/bootstrap/js/bootstrap.min.js}"></script>
</body>
</html>